<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<script src="js/mui.min.js"></script>
		<link href="css/mui.min.css" rel="stylesheet" />
		<script type="text/javascript" charset="UTF-8">
			//嵌套，创建子页面  返回后触发自定义事件
			mui.init({
				beforeback: function() {
					//获得列表界面的webview
					var login = plus.webview.getWebviewById('login');
					var loginId = "123";
					//触发列表界面的自定义事件diy
					mui.fire(login, 'diy', {
						id: loginId
					});
					//返回true，继续页面关闭逻辑
					return true;
				},
				subpages: [{
					url: 'newwindow.html',
					id: 'newwindow',
					styles: {
						top: '45px', //mui标题栏默认高度为45px；
						bottom: '0px' //默认为0px，可不定义；
					},
					swipeBack: true, //启用右滑关闭功能
					keyEventBind: {
						backbutton: false //关闭Android手机的back按键监听
					}
				}],
				keyEventBind: {
					backbutton: true,  //Boolean(默认true)关闭back按键监听
					menubutton: false   //Boolean(默认true)关闭back按键监听
				},
				statusBarBackground: '#def030'//设置状态栏颜色,仅iOS可用
			});
			//打开子页面
			mui.plusReady(function() {
				document.getElementById("openBtn").addEventListener("tap", function() {
					mui.openWindow({
						url: 'setting.html',
						id: 'setting',
						extras: {
							name: 'mui' //自定义扩展参数，可以用来处理页面间传值
						},
						show: {
							autoShow: true //页面loaded事件发生后自动显示，默认为true
						},
						waiting: {
							autoShow: true, //自动显示等待框，默认为true
							title: '正在加载...' //等待对话框上显示的提示内容
						}
					});
				});
			});
		</script>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<button type="button" class="mui-btn mui-btn-primary mui-pull-right" id="openBtn">打开</button>
			<h1 class="mui-title">打开子页面</h1>
		</header>
	</body>
</html>